package com.dnjn.happiness.common.tenant;


import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

import javax.annotation.PostConstruct;
import java.util.List;

@Slf4j
@Data
@Order(Integer.MIN_VALUE)
@Configuration

@ConfigurationProperties(prefix = "tenant") // 配置文件的前缀
public class TenantProps {
    /**
     * 是否开启多租户
     */
    private Boolean enabled = true;

    /**
     * 租户id字段名
     */
    private String column = "tenant_id";

    /**
     * 多租户筛选查询，忽略表列表
     */
    private List<String> ignoreTable;

    private List<String> ignoreLoginName;

//    public static List<String> IGNORE_TABLE_NAME;
//    public static List<String> IGNORE_LOGIN_NAME;

    @PostConstruct
    public void init() {
        log.info("init tenant prop");
//        IGNORE_TABLE_NAME = ignoreTable;
//        IGNORE_LOGIN_NAME= ignoreLoginName;
    }

}
